//
//  HMDocRequireModel.m
//  仿真开发
//
//  Created by LZH on 2017/3/23.
//  Copyright © 2017年 B.HOPE. All rights reserved.
//
/*
 2017-03-24 15:46:49.352 项目接口Demo[1538:43422] responseObject = {
	msg : OK,
	data : {
	receiving_setting_extra : 特殊条件特殊条件特殊条件特殊条件特殊条件特殊条件 特殊条件特殊条件特殊条件特殊条件特殊条件特殊条件特殊条件特殊条件特殊条件啊谁都发生地方,
	receiving_settings : [
	需要提供并发症,
	需要患者为首诊,
	需要提供个人史,
	需要提供疾病描述,
	需要提供病例
 ]
 },
	code : 0
 }
 */

#import "HMDocRequireModel.h"
#import "HMTool.h"
@implementation HMDocRequireModel

+(void)getDocRequireDataWithURLString:(NSString *)URLString andParameters:(NSDictionary *)parameters andSuccessBlock:(void (^)(NSArray *))successBlock andErrorBlock:(void (^)(NSError *))errorBlock{
    
    [[HMTool sharedNetworkTool]POSTWithURLString:URLString parameters:parameters success:^(id responseObject) {
        
        NSDictionary*jsons=[NSJSONSerialization JSONObjectWithData:responseObject options:0 error:nil];
        
        NSDictionary*dic=jsons[@"data"];
        
        HMDocRequireModel*model=[HMDocRequireModel new];
        
        [dic enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
            [model setValue:dic[key] forKey:key];
        }];
        NSArray*newList=[NSArray arrayWithObject:model];
        
        if (successBlock) {
            successBlock(newList);
        }
        
    } faile:^(NSError *error) {
        if (errorBlock) {
            errorBlock(error);
        }
    }];
    
}

//
-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}

@end
